﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@include file="/include.jsp"%>
<link rel="stylesheet" href="${ctx}/ztree/css/zTreeStyle/zTreeStyle.css" />
<script src="${ctx}/jquery/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="${ctx}/ztree/js/jquery.ztree.all.min.js" type="text/javascript"></script>

<script type="text/javascript">
$.post(
		"${ctx}/tree/fareTree.do",	
		{pId:"135"},
		function(msg){
			var setting = {
					data: {
						simpleData: {
							enable: true
						}
					},
					callback: {
						onClick:function zTreeOnClick(event, treeId, treeNode) {
							if(treeNode.name!='逸天教育科技有限公司'){
								$.post(
										"${ctx}/tree/getFareData.do?id="+treeNode.id,
										function(msg){
											if(msg=="true"){
												parent.workareaFrame.location = "./detail.jsp";
											}
										},
										"text"
								)
							}else{
								return;
								}
						    
						},
							
					}
				}; 
			 var zNodes =msg;
			$(document).ready(function(){
				$.fn.zTree.init($("#permission_tree"), setting, zNodes);
			});
		},
		"json"
		) 
		</script>
<ul id="permission_tree" class="ztree">
</ul>
